﻿namespace EnterpriseLibrary.Caching.AzureBackingStore
{
    using System;

    using Microsoft.Practices.EnterpriseLibrary.Caching;

    public class AzureCacheItem
    {
        #region Constructors

        public AzureCacheItem()
        {
        }

        public AzureCacheItem(
            string key,
            object data,
            ICacheItemRefreshAction refreshAction,
            ICacheItemExpiration[] expirations,
            CacheItemPriority scavengingPriority,
            DateTime lastAccessedTime)
        {
            this.Key = key;
            this.Data = data;
            this.RefreshAction = refreshAction;
            this.Expirations = expirations;
            this.ScavengingPriority = scavengingPriority;
            this.LastAccessedTime = lastAccessedTime;
        }

        #endregion Constructors

        #region Properties

        public object Data
        {
            get; set;
        }

        public ICacheItemExpiration[] Expirations
        {
            get; set;
        }

        // User-provided data
        public string Key
        {
            get; set;
        }

        // Internal housekeeping information
        public DateTime LastAccessedTime
        {
            get; set;
        }

        // User-provided housekeeping information
        public ICacheItemRefreshAction RefreshAction
        {
            get; set;
        }

        public CacheItemPriority ScavengingPriority
        {
            get; set;
        }

        #endregion Properties
    }
}